From: Paul Eggert Date: Tue, 19 Apr 2011 01:11:43 +0000 (-0700) Subject: * fns.c (internal_equal): Don't assume size_t fits in int. X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1~1^2~324^2~4024^2~46 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=606f769e864a18e1ae73c37b725e1e915ede57f8;p=emacs.git * fns.c (internal_equal): Don't assume size_t fits in int. --- diff --git a/src/ChangeLog b/src/ChangeLog index 21b5bd2cfa1..c44f9a0a6f0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,7 @@ 2011-04-19 Paul Eggert + * fns.c (internal_equal): Don't assume size_t fits in int. + * alloc.c (compact_small_strings): Tighten assertion a little. Replace pEd with more-general pI, and fix some printf arg casts. diff --git a/src/fns.c b/src/fns.c index 3771820753e..20190399f9a 100644 --- a/src/fns.c +++ b/src/fns.c @@ -2063,14 +2063,12 @@ internal_equal (register Lisp_Object o1, register Lisp_Object o2, int depth, int /* Boolvectors are compared much like strings. */ if (BOOL_VECTOR_P (o1)) { - int size_in_chars - = ((XBOOL_VECTOR (o1)->size + BOOL_VECTOR_BITS_PER_CHAR - 1) - / BOOL_VECTOR_BITS_PER_CHAR); - if (XBOOL_VECTOR (o1)->size != XBOOL_VECTOR (o2)->size) return 0; if (memcmp (XBOOL_VECTOR (o1)->data, XBOOL_VECTOR (o2)->data, - size_in_chars)) + ((XBOOL_VECTOR (o1)->size + + BOOL_VECTOR_BITS_PER_CHAR - 1) + / BOOL_VECTOR_BITS_PER_CHAR))) return 0; return 1; }